<?php
class MyQuiz_Form_Decorator_SimpleCheckBox extends Zend_Form_Decorator_Abstract
{
	protected $_format = '<dd class="%s"><input id="%s" name="%s" type="checkbox" value="%s"/><label for="%s">%s</label></dd>';

	public function render($content)
	{
		$options = $this->getOptions();
		$class = '';
		if (isset($options['class'])) $class = $options['class'];
		$element = $this->getElement();
		$name    = htmlentities($element->getFullyQualifiedName());
		$label   = htmlentities($element->getLabel());
		$id      = htmlentities($element->getId());
		$value   = htmlentities($element->getValue());

		$markup  = sprintf($this->_format, $class, $id, $name, $value, $id, $label);
		return $markup;
	}
}